﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DOMercury.Engine;
using DOMercury.Items;
using DOMercury.Interfaces;

namespace NirCmdPlugin
{
    public class Dialog : IItem
    {
        #region IItem Members

        public string DisplayName
        {
            get { return "Dialog Box"; }
        }

        public string ItemType
        {
            get { return "DialogItem"; }
        }

        public string DisplayDesc
        {
            get { return "Active Dialog Box"; }
        }

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

    public class DialogClick : IItem
    {
        private string name = "OK";

        public DialogClick(string Name)
        {
            name = Name;
        }
        #region IItem Members

        public string DisplayName
        {
            get { return name; }
        }

        public string ItemType
        {
            get { return "DialogClickItem"; }
        }

        public string DisplayDesc
        {
            get { return "Dialog Click Option"; }
        }

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

    public class Monitor : IItem
    {
        //private string name = "OK";

        
        #region IItem Members

        public string DisplayName
        {
            get { return "Monitor"; }
        }

        public string ItemType
        {
            get { return "MonitorItem"; }
        }

        public string DisplayDesc
        {
            get { return "The Monitor"; }
        }

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

    public class LockWorkStation : IItem
    {
        //private string name = "OK";


        #region IItem Members

        public string DisplayName
        {
            get { return "Lock Workstation"; }
        }

        public string ItemType
        {
            get { return "LockWorkstationItem"; }
        }

        public string DisplayDesc
        {
            get { return "Lock the Workstation"; }
        }

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

    public class Services : IItem
    {
        //private string name = "OK";


        #region IItem Members

        public string DisplayName
        {
            get { return "Windows Services"; }
        }

        public string ItemType
        {
            get { return "ServicesItem"; }
        }

        public string DisplayDesc
        {
            get { return "List of Windows Services"; }
        }

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

    public class Service : IItem
    {
        
        private System.ServiceProcess.ServiceController service;
        public Service(System.ServiceProcess.ServiceController theService)
        {
            service = theService;
        }

        #region IItem Members

        public string DisplayName
        {
            get { return service.DisplayName; }
        }

        public string ItemType
        {
            get { return "ServiceItem"; }
        }

        public string DisplayDesc
        {
            get { return service.Status.ToString(); }
        }

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

    public class GenericItem : IItem
    {

        private string name = "Generic";
        private string desc = "Item";
        private object obj;
        public GenericItem(string Name, object theObj, string Description)
        {
            name = Name;
            obj = theObj;
            desc = Description;
        }

        public object Object
        {
            get
            {
                return obj;
            }
            set
            {
                obj = value;
            }
        }

        #region IItem Members

        public string DisplayName
        {
            get { return name; }
        }

        public string ItemType
        {
            get { return "ServiceItem"; }
        }

        public string DisplayDesc
        {
            get { return desc; }
        }

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

}
